#ifndef CLIENTTHREAD_HPP
#define CLIENTTHREAD_HPP

#include "Runnable.hpp"
#include "RequestManager.hpp"
#include "ClientManager.hpp"

/** 
 * thread client handling
 **/
class ClientThread:public Runnable
{
	public :
	int nbClients;
	int epfd;
	int maxClients;
	struct epoll_event* epollEvents;
	RequestManager* requestManager;
	ClientManager* clientManager;

	/* epoll lock & cond */
	pthread_mutex_t epLock;
	pthread_cond_t epCond;
	
	/* methods */
	int addClient(int sfd);

	/* constructor */
	ClientThread(int maxClients,RequestManager* requestManager,ClientManager* clientManager);

	/* implements interface */
	virtual void run();
};

#endif
